<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
		$('#chrcount').keyup(function(){
			var len = $('#chrcount').val();
			var char = len.length;	
			if(254-char == 0){
				}
			$('#chrcountlength').html(255-char);	
		});
	});
	
	$(document).ready(function(){
		$('#chrcount2').keyup(function(){
			var len = $('#chrcount2').val();
			var char = len.length;	
			if(254-char == 0){
				}
			$('#chrcountlength2').html(255-char);	
		});
	});
</script>

<div id="mws-container" class="clearfix">
<div class="container">
  <div class="mws-panel grid_8">
    <div class="mws-panel-header"> <span class="mws-i-24 i-list"><?php echo "Edit"; ?> Attribute</span> </div>
    <div class="mws-panel-body">
      <div class="mws-form-inline">
       <?php echo $form->create(array('controller'=>'setups','action'=>'','method'=>'post','class' => 'mws-form')); ?>
          <?php 
		if(isset($details['Attribute']['id'])){$details['Attribute']['id']=$details['Attribute']['id'];}else{$details['Attribute']['id']="";}
		  echo $this->Form->input('Attribute.id', array('type' => 'hidden','value'=>$details['Attribute']['id']));?>
        <div class="mws-form-row">
          <label>* Title :</label>
          <div class="mws-form-item small"> 
		<?php 
			if(isset($details['Attribute']['name'])){$details['Attribute']['name']=$details['Attribute']['name'];}else{$details['Attribute']['name']="";}
			echo $this->Form->input('Attribute.name', array('type' => 'text','value'=>$details['Attribute']['name'],'class'=>'mws-textinput','label' =>false));
        ?>
 </div>
        </div>
        <div class="mws-form-row">
          <label>Sort Type :</label>
          <div class="mws-form-item 	small">
           <?php 
			if(isset($details['Attribute']['sort'])){$details['Attribute']['sort']=$details['Attribute']['sort'];}else{$details['Attribute']['sort']="";}

		   echo $this->Form->input('Attribute.sort', array('type' => 'text','value'=>$details['Attribute']['sort'],'class'=>'mws-textinput','label' =>false));?> </div>
        </div>
            <div class="mws-form-row">
            <label>Group Type :</label>
            <div class="mws-form-item small">
                <?php 			if(isset($details['Attribute']['attr_gp_id'])){$details['Attribute']['attr_gp_id']=$details['Attribute']['attr_gp_id'];}else{$details['Attribute']['attr_gp_id']="";}

echo $this->Form->input('Attribute.attr_gp_id', 
                array('type' => 'select','options'=>$att_groups,
                'default'=>$details['Attribute']['attr_gp_id'],'class'=>'mws-textinput','empty'=>false,'label' =>false));?>
            </div>
        </div>
        <div class="mws-form-row">
          <label>Status Type :</label>
          <div class="mws-form-item 	small">
            <?php 
			if(isset($details['Attribute']['status'])){$details['Attribute']['status']=$details['Attribute']['status'];}else{$details['Attribute']['status']="";}
				$options = array('1'=>'Active', '0'=>'Deactive'); 
					echo $this->Form->input('Attribute.status', 
					array('type' => 'select','options'=>$options,
					'default'=>$details['Attribute']['status'],'class'=>'mws-textinput','empty'=>false,'label' =>false)
				);
			?>
          </div>
        </div>
        <div class="mws-form-row">
          <label>Required Type :</label>
          <div class="mws-form-item 	small">
            <?php 
			if(isset($details['Attribute']['required'])){$details['Attribute']['required']=$details['Attribute']['required'];}
			else{$details['Attribute']['required']="";}
				$options = array('1'=>'Required', '0'=>'Optional'); 
					echo $this->Form->input('Attribute.required', 
					array('type' => 'select','options'=>$options,
					'default'=>$details['Attribute']['required'],'class'=>'mws-textinput','empty'=>false,'label' =>false)
				);
			?>
          </div>
        </div>
        <div class="mws-button-row">
          <input type="submit" class="mws-button black" value="Submit">
        </div>
        </form>
      </div>
    </div>
  </div>
</div>
s